package ui;

import com.planesnet.task1.R;
import com.planesnet.task1.Task;
import com.planesnet.task1.R.id;
import com.planesnet.task1.R.layout;
import com.planesnet.task1.R.menu;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;

public class TaskDetailActivity extends Activity {

	TextView txtName;
	Intent intent;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_task_detail);

		txtName = (TextView) this.findViewById(R.id.txtName);

		// Recuperar los datos recibidos.
		intent = getIntent();

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.task_detail, menu);
		return true;
	}

	public void OnClickSave(View v) {
		String taskName = txtName.getText().toString();
		Task.setContext(this);
		Task task = new Task();
		
		task.setName(taskName);
		task.create();
		
		/*
		 * intent.putExtra("taskName", taskName );
		 
		setResult(RESULT_OK, intent);
		finish();
		*/
	}

}
